﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelProject.Entities;
using System.Globalization;
using ModelProject.Repositorios;
using ModelProject;
using DataProject.UnitOfWork;

namespace DataProject.Repositorios
{
    public class TiposDocumentosRepository : Repository<TipoDocumento>, ITiposDocumentosRepository
    {
        public TiposDocumentosRepository(IQueryableUnitOfWork unitOfWork)
            : base(unitOfWork)
        {
        }

        public IEnumerable<TipoDocumento> GetTiposDocumentos()
        {
            var activeContext = UnitOfWork as IMainModuleUnitOfWork;
            if (activeContext == null)
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Resources.Messages.InvalidContext", this.GetType().Name));
            return activeContext.TipoDocumento;
        }
    }
}
